package com.xebest.web.controller.aftersales;

import com.github.pagehelper.PageHelper;
import com.xebest.api.util.OpertorLogUtil;
import com.xebest.common.base.controller.BASEMessage;
import com.xebest.common.base.controller.BaseController;
import com.xebest.common.base.controller.BaseResponse;
import com.xebest.common.enums.erp.aftersales.VenGoodsCheckStatusEnum;
import com.xebest.common.enums.erp.aftersales.VenGoodsRejectStatusEnum;
import com.xebest.common.enums.erp.sys.VenDelEnum;
import com.xebest.common.enums.logtype.ErpLogTypeEnum;
import com.xebest.common.util.RequestUtil;
import com.xebest.config.ParamConfig;
import com.xebest.constant.XeConstans;
import com.xebest.util.DateUtil;
import com.xebest.util.Money;
import com.xebest.util.SysSetBeanUtils;
import com.xebest.util.msg.XeVenAfterSaleMsg;
import com.xebest.web.form.*;
import com.xebest.web.model.XeVenGoodsRejectEntity;
import com.xebest.web.model.XeVenStoreReceiptDetailEntity;
import com.xebest.web.model.base.XePageInfo;
import com.xebest.web.service.XeVenGoodsRejectService;
import com.xebest.web.view.ErpUserInfo;
import com.xebest.web.view.XeVenGoodsRejectDetailView;
import com.xebest.web.view.XeVenRejectView;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.*;

/**
 * 退货单相关Controller
 *
 * @author chenjing
 */
@RestController
@RequestMapping("goodsReject")
@Scope("prototype")
public class XeVenGoodsRejectController extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(XeVenAfterSaleController.class);//日志记录类
    @Autowired
    private XeVenGoodsRejectService xeVenGoodsRejectService;
    @Autowired
    private ParamConfig paramConfig;

    /**
     * 退货单审核--退货审核（已不用）
     *
     * @author chenjing
     */
    @RequestMapping(value = "batchGoodsRejectByManger", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse batchGoodsRejectByManger(@RequestBody @Validated XeVenAfterSaleCheckForm form,
                                          BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单退货审核缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }
        if (VenGoodsCheckStatusEnum.REJECT_BACKED.getValue().equals(form.getCheckStatus()) && StringUtils.isBlank(form.getRefusReason())) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }

        try {
            int flag = batchGoodsReject(form, VenGoodsCheckStatusEnum.REJECT_CHECKING.getValue());
            if (flag > 0) return sendAjaxOK();
            else return sendAjaxError();
        } catch (Exception e) {
            log.error("================退货单审核--退货审核异常================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 退货单审核--退货审核（已不用）
     *
     * @author chenjing
     */
    @RequestMapping(value = "batchRejectListByManger", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse batchRejectListByManger(@RequestBody @Validated XeVenAfterSaleCheckForm form,
                                         BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单退货批量审核缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }
        if (VenGoodsCheckStatusEnum.REJECT_BACKED.getValue().equals(form.getCheckStatus()) && StringUtils.isBlank(form.getRefusReason())) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        try {
            int flag = batchGoodsRejectList(form, 1);
            if (flag > 0) return sendAjaxOK();
            else return sendAjaxError();
        } catch (Exception e) {
            log.error("================退货单批量审核--退货批量审核异常================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 退货单审核--财务审核（已不用）
     *
     * @author chenjing
     */
    @RequestMapping(value = "batchGoodsRejectByFinance", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse batchGoodsRejectByFinance(@RequestBody @Validated XeVenAfterSaleCheckForm form,
                                           BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单财务审核缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }
        if (VenGoodsCheckStatusEnum.FINANCE_BACKED.getValue().equals(form.getCheckStatus()) && StringUtils.isBlank(form.getRefusReason())) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        try {
            int flag = batchGoodsReject(form, VenGoodsCheckStatusEnum.FINANCE_CHECKING.getValue());
            if (flag > 0) return sendAjaxOK();
            else return sendAjaxError();
        } catch (Exception e) {
            log.error("================退货单审核--财务审核异常================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 退货单批量审核--财务批量审核 （已不用）
     *
     * @author chenjing
     */
    @RequestMapping(value = "batchRejectListByFinance", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse batchRejectListByFinance(@RequestBody @Validated XeVenAfterSaleCheckForm form,
                                          BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单财务批量审核缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }
        String[] formCodes = form.getFormCodes();
        if (formCodes.length == 0) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        if (VenGoodsCheckStatusEnum.FINANCE_BACKED.getValue().equals(form.getCheckStatus()) && StringUtils.isBlank(form.getRefusReason())) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        try {
            int flag = batchGoodsRejectList(form, 2);
            if (flag > 0) return sendAjaxOK();
            else return sendAjaxError();
        } catch (Exception e) {
            log.error("================退货单批量审核--财务批量审核异常================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 更新退货单通用方法 (退货审核，财务审核，签订)使用 （已不用）
     *
     * @param form   前台提交状态更新表单
     * @param status 目前退货单的状态
     * @author chenjing
     */
    private int batchGoodsReject(XeVenAfterSaleCheckForm form, int status) throws Exception {
        String rejectCode = form.getFormCode(); //退货单号
        int checkStatus = form.getCheckStatus(); //审核状态
        String refusReason = form.getRefusReason(); //审核驳回原因
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        //根据退货单号查询退货单信息
        XeVenGoodsRejectEntity entity = xeVenGoodsRejectService.getGoodsRejectByRejectCode(rejectCode, userCode);
        //验证退货单是否存在
        if (null == entity) {
            log.error("退货单不存在！退货单号，{}", rejectCode);
            throw new Exception();
        }
        if (status != entity.getCheckStatus()) {
            log.error("退货单状态异常！退货单号{},退货单状态{},预更新状态{}", rejectCode, entity.getCheckStatus(), checkStatus);
            throw new Exception();
        }
        //封装退货单entity
        if (VenGoodsCheckStatusEnum.SIGNING.getValue().equals(checkStatus)) {  //退货审核通过 待签订状态
            entity.setRejectStatus(VenGoodsRejectStatusEnum.REJECTING.getValue());
        }
        entity.setCheckStatus(checkStatus);
        entity.setModifyUser(userInfo.getUserName());
        entity.setRefusReason(refusReason);
        return xeVenGoodsRejectService.updateGoodsReject(entity);
    }

    /**
     * 批量审核退货单通用方法 (退货审核，财务审核，签订)使用 （已不用）
     *
     * @param form 前台提交状态更新表单
     * @author chenjing
     */
    private int batchGoodsRejectList(XeVenAfterSaleCheckForm form, int checkType) throws Exception {
        int checkStatus = form.getCheckStatus();
        String[] formCodes = form.getFormCodes();
        form.setFormCodes(formCodes);
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        form.setModifyUser(userInfo.getUserName());
        form.setUserCode(userCode);
        int rejectStatus = VenGoodsRejectStatusEnum.REJECTING.getValue(); //退货单状态
        List checkStatusList = new ArrayList(); //退货单审核状态（筛选条件使用）
        //如果审核状态为待签订（财务已审核），需要同步更新退货单状态为退货中
        if (VenGoodsCheckStatusEnum.SIGNING.getValue().equals(checkStatus)) {
            rejectStatus = VenGoodsRejectStatusEnum.REJECTING.getValue();
        }
        if (checkType == 1) {
            checkStatusList.add(VenGoodsCheckStatusEnum.REJECT_CHECKING.getValue());
            checkStatusList.add(VenGoodsCheckStatusEnum.REJECT_BACKED.getValue());
            checkStatusList.add(VenGoodsCheckStatusEnum.FINANCE_BACKED.getValue());
        } else {
            checkStatusList.add(VenGoodsCheckStatusEnum.FINANCE_CHECKING.getValue());
        }

        return xeVenGoodsRejectService.batchGoodsRejectList(form, rejectStatus, checkStatusList);
    }

    /**
     * 退货单收货入库
     *
     * @author chenjing
     */
    @RequestMapping(value = "receiveGoodsReject", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse receiveGoodsReject(@RequestBody @Validated XeVenRejectSubmitForm form,
                                    BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单收货入库缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }

        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        String rejectCode = form.getRejectCode(); //退货单号
        String operatorContent = "对退货单:" + rejectCode + "中的";               //记录日志信息
        //根据退货单号查询退货单信息
        XeVenGoodsRejectEntity entity = xeVenGoodsRejectService.getGoodsRejectByRejectCode(rejectCode, userCode);
        //验证退货单是否存在
        if (null == entity) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        try {
            //判断明细商品中退货数量是否都为0或者空
            boolean rejectStatus = false;
            //判断已入库数量+本次退货数量是否大于退货数量
            //从数据库中获取退货单明细信息
            XeVenAfterSaleDetailForm detailForm = new XeVenAfterSaleDetailForm();
            detailForm.setRejectCode(entity.getRejectCode());
            detailForm.setUserCode(userCode);
            List<XeVenGoodsRejectDetailView> rejectDetailList = xeVenGoodsRejectService.queryRejectDetail(detailForm);
            for (XeVenGoodsRejectDetailView detailView : rejectDetailList) {
                for (XeVenStoreReceiptDetailEntity detailEntity : form.getList()) {
                    if (detailView.getProSku().equals(detailEntity.getProSku())) {
                        //获取已入库数量
                        BigDecimal finishNum = detailView.getFinishNum();
                        finishNum = finishNum == null ? new BigDecimal("0") : finishNum;
                        //本次入库数量
                        if (detailEntity.getCurrentInNum() == null) detailEntity.setCurrentInNum(new BigDecimal(0));
                        BigDecimal currentInNum = detailEntity.getCurrentInNum();
                        currentInNum = null == currentInNum ? new BigDecimal(0) : currentInNum;
                        if (Money.of(currentInNum).isGreaterThan(Money.of(0))) {
                            rejectStatus = true;
                        }
                        //获取退货数量
                        BigDecimal rejectNum = detailView.getRejectNum();
                        rejectNum = null == rejectNum ? new BigDecimal(0) : rejectNum;
                        //验证退货数量
                        if (Money.of(finishNum).plus(Money.of(currentInNum)).isGreaterThan(Money.of(rejectNum))) {
                            log.error("退货单确认收货入库数量大于退货数量，退货单号={},sku={},本次入库数量={},已入库数量={}，" +
                                    "退货数量={}", entity.getRejectCode(), detailView.getProSku(), currentInNum, finishNum, rejectNum);
                            return sendAjaxError(XeVenAfterSaleMsg.AFTER_SALE_REJECT_NUM_ERR);
                        }
                        operatorContent += "商品:" + detailView.getProSku() + "退货收货入库，入库数量:" + rejectNum;
                    }
                }
            }

            //验证商品本次入库数量是否都为空或0
            if (!rejectStatus) {
                return sendAjaxError(BASEMessage.PARAM_ERROR);
            }
            form.setUserCode(userCode);
            form.setUserName(userInfo.getUserName());
            //封装退货单entity
            entity.setModifyUser(userInfo.getUserName());
            int flag = xeVenGoodsRejectService.receiveGoodsReject(form);
            if (flag > 0) {
                //插入日志信息
                insertMqLog("", rejectCode, operatorContent);
                return sendAjaxOK();
            } else return sendAjaxError();
        } catch (Exception e) {
            log.error("================退货单收货入库异常================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 退货单批量完成
     *
     * @author chenjing
     */
    @RequestMapping(value = "receiveGoodsRejectList", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse receiveGoodsRejectList(@RequestBody @Validated XeVenAfterSaleCheckForm form,
                                        BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单批量完成缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }
        String[] formCodes = form.getFormCodes();
        if (formCodes.length == 0) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        form.setFormCodes(formCodes);
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        form.setModifyUser(userInfo.getUserName());
        form.setUserCode(userCode);
        try {
            int flag = xeVenGoodsRejectService.receiveGoodsRejectList(form);
            if (flag > 0) {
                //插入日志信息
                insertMqLog("", formCodes.toString(), "完成入库，退货单号：" + formCodes);
                return sendAjaxOK();
            } else return sendAjaxError();
        } catch (Exception e) {
            log.error("================退货单批量完成异常================,{}", e);
            return sendAjaxError();
        }
    }


    /**
     * 删除退货单 (已不用)
     *
     * @author chenjing
     */
    @RequestMapping(value = "delGoodsReject", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse delGoodsReject(@RequestBody XeVenAfterSaleDetailForm form) {
        if (null == form) return sendAjaxError(BASEMessage.PARAM_ERROR);
        String rejectCode = form.getRejectCode();  //退货单号
        if (StringUtils.isBlank(rejectCode)) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        log.info("删除退货单,退货单号={},userCode={}", rejectCode, userCode);
        XeVenGoodsRejectEntity entity = xeVenGoodsRejectService.getGoodsRejectByRejectCode(rejectCode, userCode);
        if (null == entity) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        entity.setModifyUser(userInfo.getUserName());
        entity.setDelFlag(VenDelEnum.YES.getValue());
        try {
            int flag = xeVenGoodsRejectService.updateGoodsReject(entity);
            if (flag > 0) return sendAjaxOK();
            else return sendAjaxError();
        } catch (Exception e) {
            log.error("================删除退货单异常======================,{}", e);
            return sendAjaxError();
        }
    }


    /**
     * 查询退货单列表
     *
     * @author chenjing
     */
    @RequestMapping(value = "queryRejectList", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse queryRejectList(@RequestBody XeVenRejectQueryForm form) {
        //获取用户登录信息
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        if (null == form) {
            form = new XeVenRejectQueryForm();
        }
        form.setUserCode(userInfo.getUserCode());
        if (StringUtils.isNotBlank(form.getFormTimeType())) {
            int formIdType = Integer.parseInt(form.getFormIdType());
            String formIdVale = form.getFormIdVlaue();
            switch (formIdType) {
                case 1:  //退货单号
                    form.setRejectCode(formIdVale);
                    break;
                case 2:  //售后单号
                    form.setAfterSaleCode(formIdVale);
                    break;
                case 3:  //订单编号
                    form.setOrderId(formIdVale);
                    break;
                case 4:  //商品名称
                    form.setProName(formIdVale);
                    break;
                case 5:  //商品货号
                    form.setProNum(formIdVale);
                    break;
                case 6:  //客户账号
                    form.setLoginAccount(formIdVale);
                    break;
                default:
                    break;
            }
        }

        String startTime = form.getFormTimeStartValue();
        String endTime = form.getFormTimeEndValue();
        //设定查询中日期为3个月以内
        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
            Boolean dateCm = DateUtil.comparableTime(startTime, endTime);
            if (!dateCm) {
                return sendAjaxError(XeVenAfterSaleMsg.AFTER_SALE_DATE_COMPARABLE);
            }
        }
        if (StringUtils.isBlank(startTime) && StringUtils.isBlank(endTime)) {
            endTime = DateUtil.getDate(new Date());
            startTime = DateUtil.strToNMonth(endTime, -3);
        }
        if (StringUtils.isBlank(startTime) && StringUtils.isNotBlank(endTime)) {
            startTime = DateUtil.strToNMonth(endTime, -3);
        }
        if (StringUtils.isBlank(endTime) && StringUtils.isNotBlank(startTime)) {
            endTime = DateUtil.strToNMonth(startTime, 3);
        }
        int formTimeType = Integer.parseInt(form.getFormTimeType());
        switch (formTimeType) {
            case 1:  //制单时间
                form.setCreateStartDate(startTime);
                form.setCreateEndDate(endTime);
                break;
            case 2: //完成时间
                form.setDoneStartDate(startTime);
                form.setDoneEndDate(endTime);
                break;
            default:
                break;
        }
        XePageInfo<XeVenRejectView> xePageInfo;
        PageHelper.startPage(form.getPageNum(), form.getPageSize(), true);

        try {
            List<XeVenRejectView> viewList = xeVenGoodsRejectService.queryRejectList(form);
            xePageInfo = new XePageInfo<>(viewList);
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("rejectViewList", viewList);
            map.put("xePageInfo", xePageInfo);
            return sendAjaxOK(map);
        } catch (Exception e) {
            log.error("================查询退货单列表异常 ================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 根据退货单号查询退货单详细信息
     *
     * @author chenjing
     */
    @RequestMapping(value = "queryRejectDetail", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse queryRejectDetail(@RequestBody @Validated XeVenAfterSaleDetailForm form,
                                   BindingResult result) {
        if (null == form) return sendAjaxError(BASEMessage.PARAM_ERROR);
        if (StringUtils.isBlank(form.getRejectCode())) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        form.setUserCode(userCode);

        XeVenGoodsRejectEntity entity = xeVenGoodsRejectService.getGoodsRejectByRejectCode(form.getRejectCode(), userCode);
        if (null == entity) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        form.setAfterSalesCode(entity.getAfterSalesCode());
        try {
            List<XeVenGoodsRejectDetailView> rejectDetailList = xeVenGoodsRejectService.queryRejectDetail(form);
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("rejectDetailList", rejectDetailList);
            map.put("picServer", paramConfig.getImgUrl());
            map.put("picDir", XeConstans.ERP_PRO_PIC_DIR);
            return sendAjaxOK(map);
        } catch (Exception e) {
            log.error("================查询退货单详细信息异常 ================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 批量删除退货单(已不用)
     *
     * @author chenjing
     */
    @RequestMapping(value = "delGoodsRejectList", method = RequestMethod.POST)
    public
    @ResponseBody
    BaseResponse delGoodsRejectList(@RequestBody @Validated XeVenAfterSaleDelForm form,
                                    BindingResult result) {
        if (result.hasErrors()) {
            FieldError fieldError = result.getFieldError();
            log.info("退货单删除退货缺少参数：{}, {}",
                    fieldError.getField(),
                    fieldError.getDefaultMessage());
            return sendAjaxError(BASEMessage.PARAM_ERROR, fieldError.getDefaultMessage());
        }
        String[] formCodes = form.getRejectFormCodes();
        if (formCodes.length == 0) {
            return sendAjaxError(BASEMessage.PARAM_ERROR);
        }
        form.setRejectFormCodes(formCodes);
        ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
        String userCode = userInfo.getUserCode();
        form.setModifyUser(userInfo.getUserName());
        form.setUserCode(userCode);
        try {
            int flag = xeVenGoodsRejectService.delGoodsRejectList(form);
            if (flag > 0) return sendAjaxOK();
            else return sendAjaxError();
        } catch (Exception e) {
            log.error("================批量退货单异常 ================,{}", e);
            return sendAjaxError();
        }
    }

    /**
     * 统一日志信息
     *
     * @author chenjing
     */
    private void insertMqLog(String logType, String key, String operatorContent) {
        try {
            String ipAddress = RequestUtil.getClientIpAddress(request);
            if (StringUtils.isBlank(logType)) {
                logType = ErpLogTypeEnum.erpAfterSaleReject.getValue();
            }
            ErpUserInfo userInfo = SysSetBeanUtils.getErpUserInfo(super.getErpLoginUserInfo());
            String userCode = userInfo.getUserCode();
            OpertorLogUtil.opertorLog.sendOperatorLogByParam(ipAddress, key, logType, userInfo.getUserName(), operatorContent, userCode);
        } catch (Exception e) {
            log.error("退货单相关MQ日志插入失败,logType={},operatorContent={}", logType, operatorContent);
        }
    }
}
